#include "TextEdit.h"

TextEdit::TextEdit(const std::string& txt, float x, float y, float width) : width(width)
{
    textBox = sf::RectangleShape(sf::Vector2f(x, y));
    textBox.SetSize(sf::Vector2f(width, 25));

    //textBox.EnableOutline(false);
}

TextEdit::~TextEdit()
{

}

void TextEdit::draw(sf::RenderWindow* window)
{
    window->Draw(textBox);
}

void TextEdit::checkClick(float x, float y)
{
    sf::FloatRect rect(textBox.GetPosition(), sf::Vector2f(width, 25.f));
    if(rect.Contains(x, y))
    {
        //sm.play("click.ogg");
        //textBox.EnableOutline(true);
        return;
    }
    //textBox.EnableOutline(false);
}
